package memento.example;

/**
 * @Author：LJ
 * @Description：
 * @Date: 2017/12/1
 * @Modified By:
 */
public class Client {
    public static void main(String[] args) {

        Boy boy = new Boy();
        boy.setState("心情很好!");
        System.out.println("男孩现在的状态:" + boy.getState());
        Memento memento = boy.createMemento();

        boy.setState("心情不好");
        System.out.println("男孩现在的状态:" + boy.getState());

        boy.setState(memento.getState());

        System.out.println("男孩现在的状态:" + boy.getState());

    }
}
